package com.mianshi;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class rongyao2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i = 0; i < N; i++){
            int num = in.nextInt();
            List<Integer> list = new ArrayList<>();
            list = isSu(num);
            Integer[] arr = list.toArray(new Integer[list.size()]);
            int m = 0, n = 0, sum=0;
            int len = arr.length;
            boolean flag = false;
            while(m < len && n < len){
                if(sum == num){
                    flag = true;
                    break;
                } else if(sum < num){
                    sum += arr[n];
                    n++;
                } else {
                    sum -= arr[m];
                    m++;
                }
            }
            if(flag){
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }

    }

    public static List<Integer> isSu(int n){
        List<Integer> list = new ArrayList<>();
        list.add(2);
        for(int i = 3; i < n; i++){
            boolean flag = true;
            for(int j = 2; j < i; j++){
                if(i % j == 0){
                    flag = false;
                    break;
                }
            }
            if(flag){
                list.add(i);
            }
        }
        return list;
    }
}
